//元祖结构体 字段没有命名，根据位置引用
struct Color(u8, u8, u8);

fn main() {
    let white = Color(255, 255, 255);
    // 可以通过索引访问具体值
    let red = white.0;
    let green = white.1;
    let blue = white.2;

    println!("Red value: {}", red);
    println!("Green value: {}", green);
    println!("Blue value: {}", blue);

    let orange = Color(255, 165, 0);
    let Color(r, g, b) = orange;
    // 直接结构字段
    println!("R: {}, G: {}, B: {} (orange)", r, g, b);

    let black = Color(0, 0, 0);
    // 在解构是忽略字段
    let Color(r, _, b) = black;
    println!("R: {}, B: {} (black)", r, b);
}